import 'package:honeypotflutter/net/public_http.dart';
import 'package:honeypotflutter/publicBussine/view/bussine_modal.dart';

class AutonymApi {
  /*
  * 提交实名认证
  * */
  static Future<bool> submitRealName(Map<String, dynamic> param) async {
    try {
      await MGHttp.put(
        "api/services/app/Account/UpdateRealNameProfile",
        params: param,
        progress: "实名认证信息提交中...",
      );
      return true;
    } catch (error) {
      MGModal.totalError(error);
      return Future.error(error);
    }
  }

  /*
  * 快递员绑定
  * */
  static Future<bool> bindExpress(String express, String workers) async {
    try {
      Map<String, dynamic> param = {
        "identificationNumber": workers,
        "courierCompanyName": express,
      };
      await MGHttp.post(
        "api/services/app/Account/RegisterCourierAsync",
        params: param,
        progress: "认证信息提交中...",
      );
      return true;
    } catch (error) {
      MGModal.totalError(error);
      return Future.error(error);
    }
  }
}
